<?php

namespace Nim\Bundle\ModelBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;

/**
 * ResellerOrder
 *
 * @ORM\Table(name="reseller_order")
 * @ORM\Entity
 */
class ResellerOrder
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="creation", type="datetime")
     */
    private $creation;

    /**
     * @var string
     *
     * @ORM\Column(name="state", type="string", length=10)
     */
    private $state;
    
    /**
     * @ORM\OneToOne(targetEntity="Campain")
     * @ORM\JoinColumn(name="campain_id")
     **/
    private $campain;

    /**
     * @ORM\ManyToMany(targetEntity="ClientOrder")
     * @ORM\JoinTable(name="client_reseller_order")
     **/
    private $clientOrders;
    
    
    /**
     * @ORM\OneToOne(targetEntity="Reseller")
     * @ORM\JoinColumn(name="reseller_id", referencedColumnName="id")
     **/
    private $reseller;

    public function __construct()
    {
    	$this->clientOrders = new ArrayCollection();
    }
    
    

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set creation
     *
     * @param \DateTime $creation
     * @return ResellerOrder
     */
    public function setCreation($creation)
    {
        $this->creation = $creation;
    
        return $this;
    }

    /**
     * Get creation
     *
     * @return \DateTime 
     */
    public function getCreation()
    {
        return $this->creation;
    }

    /**
     * Set state
     *
     * @param string $state
     * @return ResellerOrder
     */
    public function setState($state)
    {
        $this->state = $state;
    
        return $this;
    }

    /**
     * Get state
     *
     * @return string 
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Set campain
     *
     * @param \Nim\Bundle\ModelBundle\Entity\Campain $campain
     * @return ResellerOrder
     */
    public function setCampain(\Nim\Bundle\ModelBundle\Entity\Campain $campain = null)
    {
        $this->campain = $campain;
    
        return $this;
    }

    /**
     * Get campain
     *
     * @return \Nim\Bundle\ModelBundle\Entity\Campain 
     */
    public function getCampain()
    {
        return $this->campain;
    }

    /**
     * Add clientOrders
     *
     * @param \Nim\Bundle\ModelBundle\Entity\ClientOrder $clientOrders
     * @return ResellerOrder
     */
    public function addClientOrder(\Nim\Bundle\ModelBundle\Entity\ClientOrder $clientOrders)
    {
        $this->clientOrders[] = $clientOrders;
    
        return $this;
    }

    /**
     * Remove clientOrders
     *
     * @param \Nim\Bundle\ModelBundle\Entity\ClientOrder $clientOrders
     */
    public function removeClientOrder(\Nim\Bundle\ModelBundle\Entity\ClientOrder $clientOrders)
    {
        $this->clientOrders->removeElement($clientOrders);
    }

    /**
     * Get clientOrders
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getClientOrders()
    {
        return $this->clientOrders;
    }

    /**
     * Set reseller
     *
     * @param \Nim\Bundle\ModelBundle\Entity\Reseller $reseller
     * @return ResellerOrder
     */
    public function setReseller(\Nim\Bundle\ModelBundle\Entity\Reseller $reseller = null)
    {
        $this->reseller = $reseller;
    
        return $this;
    }

    /**
     * Get reseller
     *
     * @return \Nim\Bundle\ModelBundle\Entity\Reseller 
     */
    public function getReseller()
    {
        return $this->reseller;
    }
}